/*
 * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. 
 *  
 * Permission to use, copy, modify, and/or distribute this software for any 
 * purpose with or without fee is hereby granted, provided that the above 
 * copyright notice and this permission notice appear in all copies. 
 *  
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
 */
#include <common.h>
#include <asm/io.h>
#include <asm/mach-types.h>
#include <configs/iproc_board.h>

unsigned int ddr_init_tab[] = {
		14,	0x05051001,
		15,	0x000a0a05,
		36,	0x01000000,
		37,	0x10000000,
		38,	0x00100400,
		39,	0x00000400,
		40,	0x00000100,
		42,	0x00000001,
		61,	0x00010100,
		78,	0x01000200,
		79,	0x02000040,
		80,	0x00400100,
		81,	0x00000200,
		83,	0x01ffff0a,
		84,	0x01010101,
		85,	0x03010101,
		86,	0x01000003,
		87,	0x0000010c,
		88,	0x00010000,
		112,	0x00000200,
		116,	0x19000000,
		117,	0x00000028,
		119,	0x00010001,
		120,	0x00010001,
		121,	0x00010001,
		122,	0x00010001,
		123,	0x00010001,
		130,	0x00000001,
		139,	0x00000001,
		148,	0xffff0001,
		149,	0x00ffff00,
		150,	0x0000ffff,
		152,	0x03030303,
		153,	0x03030303,
		156,	0x02006400,
		157,	0x02020202,
		158,	0x02020202,
		160,	0x01020202,
		161,	0x01010064,
		162,	0x01010101,
		163,	0x01010101,
		165,	0x00020101,
		166,	0x00000064,
		168,	0x000a0a00,
		170,	0x02000200,
		171,	0x02000200,
		175,	0x02000200,
		176,	0x02000200,
		180,	0x80000100,
		181,	0x04070303,
		182,	0x0000000a,
		185,	0x0010ffff,
		187,	0x0000000f,
		194,	0x00000204,
		205,	0x00000040,
		0xffffffff
	};

unsigned int ddr2_init_tab[] = {
		0,	0x00000400,
		3,	0x00000043,
		4,	0x000000a7,
		5,	0x0a040a02,
		6,	0x04020404,
		7,	0x05030e14,
		8,	0x030e1404,
		9,	0x04020305,
		10,	0x03005b26,
		11,	0x04020303,
		12,	0x03005b26,
		13,	0x01000003,
		16,	0x030000c8,
		17,	0x00860000,
		18,	0x05050086,
		20,	0x00002301,
		21,	0x00230a24,
		22,	0x00050a24,
		23,	0x00000200,
		24,	0x000a0002,
		25,	0x0002000a,
		26,	0x00020008,
		27,	0x00c80008,
		28,	0x00c80027,
		29,	0x00000027,
		30,	0x03000001,
		31,	0x00030303,
		44,	0x00085300,
		45,	0x00000004,
		46,	0x00040853,
		48,	0x08530000,
		49,	0x00000004,
		50,	0x00040853,
		52,	0x08530000,
		53,	0x00000004,
		54,	0x00040853,
		56,	0x08530000,
		57,	0x00000004,
		58,	0x00040853,
		82,	0x01030101,
		108,	0x02020101,
		109,	0x08080404,
		110,	0x03020200,
		111,	0x01000202,
		128,	0x001d1d00,
		129,	0x1d1d0001,
		133,	0x00011d1d,
		134,	0x00011d1d,
		137,	0x001d1d00,
		138,	0x1d1d0001,
		142,	0x00011d1d,
		143,	0x00011d1d,
		146,	0x001d1d00,
		147,	0x1d1d0001,
		169,	0x0a240000,
		172,	0x00000a24,
		173,	0x000032b4,
		174,	0x0a240404,
		177,	0x00000a24,
		178,	0x000032b4,
		179,	0x02020404,
		186,	0x15070303,
		202,	0x0001046b,
		203,	0x0001046b,
		206,	0x01030301,
		207,	0x00000001,
		0xffffffff
};

unsigned int ddr2_init_tab_400[] = {
    0,		0x00000400,
    1,		0x00000000, 
    3,    0x00000050,     
    4,    0x000000c8, 
    5,    0x0c050c02, 
    6,    0x04020405, 
    7,    0x05031015, 
    8,    0x03101504, 
    9,    0x05020305, 
    10,   0x03006d60, 
    11,   0x05020303, 
    12,   0x03006d60, 
    13,   0x01000003, 
    14,   0x05061001, 
    15,   0x000b0b06, 
    16,   0x030000c8, 
    17,   0x00a01212, 
    18,   0x060600a0, 
    19,   0x00000000, 
    20,   0x00003001, 
    21,   0x00300c2d, 
    22,   0x00050c2d, 
    23,   0x00000200, 
    24,   0x000a0002, 
    25,   0x0002000a, 
    26,   0x00020008, 
    27,   0x00c80008, 
    28,   0x00c80037, 
    29,   0x00000037, 
    30,   0x03000001, 
    31,   0x00030303, 
    32,   0x00000000,
    35,   0x00000000, 
    36,   0x01000000, 
    37,   0x10000000, 
    38,   0x00100400, 
    39,   0x00000400, 
    40,   0x00000100, 
    41,   0x00000000, 
    42,   0x00000001, 
    43,   0x00000000, 
    44,   0x000a6300, 
    45,   0x00000004, 
    46,   0x00040a63, 
    47,   0x00000000, 
    48,   0x0a630000, 
    49,   0x00000004, 
    50,   0x00040a63, 
    51,   0x00000000, 
    52,   0x0a630000, 
    53,   0x00000004, 
    54,   0x00040a63, 
    55,   0x00000000, 
    56,   0x0a630000, 
    57,   0x00000004, 
    58,   0x00040a63, 
    59,   0x00000000, 
    60,   0x00000000, 
    61,   0x00010100, 
    62,   0x00000000, 
    63,   0x00000000, 
    64,   0x00000000, 
    65,   0x00000000, 
    66,   0x00000000, 
    67,   0x00000000, 
    68,   0x00000000, 
    69,   0x00000000, 
    70,   0x00000000, 
    71,   0x00000000, 
    72,   0x00000000, 
    73,   0x00000000, 
    74,   0x00000000, 
    75,   0x00000000, 
    76,   0x00000000, 
    77,   0x00000000, 
    78,   0x01000200, 
    79,   0x02000040, 
    80,   0x00400100, 
    81,   0x00000200, 
    82,   0x01030001, 
    83,   0x01ffff0a, 
    84,   0x01010101, 
    85,   0x03010101, 
    86,   0x01000003, 
    87,   0x0000010c, 
    88,   0x00010000, 
    89,   0x00000000, 
    90,   0x00000000, 
    91,   0x00000000, 
    92,   0x00000000, 
    93,   0x00000000, 
    94,   0x00000000, 
    95,   0x00000000, 
    96,   0x00000000, 
    97,   0x00000000, 
    98,   0x00000000, 
    99,   0x00000000, 
    100,  0x00000000, 
    101,  0x00000000, 
    102,  0x00000000, 
    103,  0x00000000, 
    104,  0x00000000, 
    105,  0x00000000, 
    106,  0x00000000, 
    107,  0x00000000, 
    108,  0x02020101, 
    109,  0x08080404, 
    110,  0x03020200, 
    111,  0x01000202, 
    112,  0x00000200, 
    113,  0x00000000, 
    114,  0x00000000, 
    115,  0x00000000, 
    116,  0x19000000, 
    117,  0x00000028, 
    118,  0x00000000, 
    119,  0x00010001, 
    120,  0x00010001, 
    121,  0x00010001, 
    122,  0x00010001, 
    123,  0x00010001, 
    124,  0x00000000, 
    125,  0x00000000, 
    126,  0x00000000, 
    127,  0x00000000, 
    128,  0x001c1c00, 
    129,  0x1c1c0001, 
    130,  0x00000001, 
    131,  0x00000000, 
    132,  0x00000000, 
    133,  0x00011c1c, 
    134,  0x00011c1c, 
    135,  0x00000000, 
    136,  0x00000000, 
    137,  0x001c1c00, 
    138,  0x1c1c0001, 
    139,  0x00000001, 
    140,  0x00000000, 
    141,  0x00000000, 
    142,  0x00011c1c, 
    143,  0x00011c1c, 
    144,  0x00000000, 
    145,  0x00000000, 
    146,  0x001c1c00, 
    147,  0x1c1c0001, 
    148,  0xffff0001, 
    149,  0x00ffff00, 
    150,  0x0000ffff, 
    151,  0x00000000, 
    152,  0x03030303, 
    153,  0x03030303, 
    156,  0x02006400, 
    157,  0x02020202, 
    158,  0x02020202, 
    160,  0x01020202, 
    161,  0x01010064, 
    162,  0x01010101, 
    163,  0x01010101, 
    165,  0x00020101, 
    166,  0x00000064, 
    167,  0x00000000, 
    168,  0x000a0a00, 
    169,  0x0c2d0000, 
    170,  0x02000200, 
    171,  0x02000200, 
    172,  0x00000c2d, 
    173,  0x00003ce1, 
    174,  0x0c2d0505, 
    175,  0x02000200, 
    176,  0x02000200, 
    177,  0x00000c2d, 
    178,  0x00003ce1, 
    179,  0x02020505, 
    180,  0x80000100, 
    181,  0x04070303, 
    182,  0x0000000a, 
    183,  0x00000000, 
    184,  0x00000000, 
    185,  0x0010ffff, 
    186,  0x16070303, 
    187,  0x0000000f, 
    188,  0x00000000, 
    189,  0x00000000, 
    190,  0x00000000, 
    191,  0x00000000, 
    192,  0x00000000, 
    193,  0x00000000, 
    194,  0x00000204, 
    195,  0x00000000, 
    196,  0x00000000, 
    197,  0x00000000, 
    198,  0x00000000, 
    199,  0x00000000, 
    200,  0x00000000, 
    201,  0x00000000, 
    202,  0x00000050, 
    203,  0x00000050, 
    204,  0x00000000, 
    205,  0x00000040, 
    206,  0x01030301, 
    207,  0x00000001, 
    0xffffffff
};
       
       
unsigned int ddr3_init_tab[] = {
       		0,	0x00000600,
       		3,	0x0001046b,
       		4,	0x00028b0b,
       		5,	0x0c050c00,
       		6,	0x04040405,
       		7,	0x05040e14,
       		8,	0x040e1404,
       		9,	0x0c040405,
       		10,	0x03005b68,
       		11,	0x0c040404,
       		12,	0x03005b68,
       		13,	0x01000004,
       		16,	0x03000200,
       		17,	0x00000f0f,
       		18,	0x05050000,
       		20,	0x00007801,
       		21,	0x00780a20,
       		22,	0x00050a20,
       		23,	0x00000300,
       		24,	0x000a0003,
       		25,	0x0000000a,
       		27,	0x02000000,
       		28,	0x0200005a,
       		29,	0x0000005a,
       		30,	0x05000001,
       		31,	0x00050505,
       		44,	0x00022000,
       		45,	0x00000046,
       		46,	0x00460210,
       		48,	0x02100000,
       		49,	0x00000046,
       		50,	0x00460210,
       		52,	0x02100000,
       		53,	0x00000046,
       		54,	0x00460210,
       		56,	0x02100000,
       		57,	0x00000046,
       		58,	0x00460210,
       		82,	0x01010001,
       		108,	0x02040108,
       		109,	0x08010402,
       		110,	0x02020202,
       		111,	0x01000201,
       		128,	0x00212100,
       		129,	0x21210001,
       		133,	0x00012121,
       		134,	0x00012121,
       		137,	0x00212100,
       		138,	0x21210001,
       		142,	0x00012121,
       		143,	0x00012121,
       		146,	0x00212100,
       		147,	0x21210001,
       		169,	0x0a200000,
       		172,	0x00000a20,
       		173,	0x000032a0,
       		174,	0x0a200505,
       		177,	0x00000a20,
       		178,	0x000032a0,
       		179,	0x02020505,
       		186,	0x16070303,
       		202,	0x00000004,
       		203,	0x00000004,
       		206,	0x01040401,
       		207,	0x00000001,
       		0xffffffff
};

unsigned int ddr3_init_tab_1333[] = {
		0,	0x00000600,
    1,	0x00000000,
		3,	0x00000086, 
		4,	0x0000014e, 
		5,	0x12071200, 
		6,	0x05040407, 
		7,	0x09051821,
		8,	0x05182105,
		9,	0x0c040509, 
		10,	0x0400b6d0, 
		11,	0x0c040504, 
		12,	0x0400b6d0, 
		13,	0x01000004, 
		14,	0x090a1001, 
		15,	0x0013130a, 
		16,	0x03000200, 
		17,	0x00001e1e, 
		18,	0x09090000, 
		19,	0x00000000, 
		20,	0x0000ea01, 
		21,	0x00ea1448, 
		22,	0x00051448, 
		23,	0x00000400, 
		24,	0x00100004, 
		25,	0x00000010, 
		26,	0x00000000, 
		27,	0x02000000, 
		28,	0x020000f0, 
		29,	0x000000f0, 
		30,	0x07000001, 
		31,	0x00070707, 
		32,	0x00000000, 
		35,	0x00000000, 
		36,	0x01000000, 
		37,	0x10000000, 
		38,	0x00100400, 
		39,	0x00000400, 
		40,	0x00000100, 
		41,	0x00000000, 
		42,	0x00000001, 
		43,	0x00000000, 
		44,	0x000a5000, 
		45,	0x00100046, 
		46,	0x00460a50, 
		47,	0x00000010, 
		48,	0x0a500000, 
		49,	0x00100046, 
		50,	0x00460a50, 
		51,	0x00000010, 
		52,	0x0a500000, 
		53,	0x00100046, 
		54,	0x00460a50, 
		55,	0x00000010, 
		56,	0x0a500000, 
		57,	0x00100046, 
		58,	0x00460a50, 
		59,	0x00000010, 
		60,	0x00000000, 
		61,	0x00010100,
		62,	0x00000000, 
		63,	0x00000000, 
		64,	0x00000000, 
		65,	0x00000000, 
		66,	0x00000000, 
		67,	0x00000000, 
		68,	0x00000000, 
		69,	0x00000000, 
		70,	0x00000000, 
		71,	0x00000000, 
		72,	0x00000000, 
		73,	0x00000000, 
		74,	0x00000000, 
		75,	0x00000000, 
		76,	0x00000000, 
		77,	0x00000000, 
		78,	0x01000200, 
		79,	0x02000040, 
		80,	0x00400100, 
		81,	0x00000200, 
		82,	0x01000001, 
		83,	0x01ffff0a, 
		84,	0x01010101, 
		85,	0x03010101, 
		86,	0x01000003, 
		87,	0x0000010c, 
		88,	0x00010000, 
		89,	0x00000000, 
		90,	0x00000000, 
		91,	0x00000000, 
		92,	0x00000000, 
		93,	0x00000000, 
		94,	0x00000000, 
		95,	0x00000000, 
		96,	0x00000000, 
		97,	0x00000000, 
		98,	0x00000000, 
		99,	0x00000000, 
		100,	0x00000000, 
		101,	0x00000000, 
		102,	0x00000000, 
		103,	0x00000000, 
		104,	0x00000000, 
		105,	0x00000000, 
		106,	0x00000000, 
		107,	0x00000000, 
		108,	0x02040108, 
		109,	0x08010402, 
		110,	0x02020202, 
		111,	0x01000201, 
		112,	0x00000200, 
		113,	0x00000000, 
		114,	0x00000000, 
		115,	0x00000000, 
		116,	0x19000000, 
		117,	0x00000028, 
		118,	0x00000000, 
		119,	0x00010001, 
		120,	0x00010001, 
		121,	0x00010001, 
		122,	0x00010001, 
		123,	0x00010001, 
		124,	0x00000000, 
		125,	0x00000000, 
		126,	0x00000000, 
		127,	0x00000000, 
		128,	0x00232300, 
		129,	0x23230001, 
		130,	0x00000001, 
		131,	0x00000000, 
		132,	0x00000000, 
		133,	0x00012323, 
		134,	0x00012323, 
		135,	0x00000000, 
		136,	0x00000000, 
		137,	0x00232300, 
		138,	0x23230001, 
		139,	0x00000001, 
		140,	0x00000000, 
		141,	0x00000000, 
		142,	0x00012323, 
		143,	0x00012323, 
		144,	0x00000000, 
		145,	0x00000000, 
		146,	0x00232300, 
		147,	0x23230001, 
		148,	0xffff0001, 
		149,	0x00ffff00, 
		150,	0x0000ffff, 
		151,	0x00000000, 
		152,	0x03030303, 
		153,	0x03030303, 
		156,	0x02006400, 
		157,	0x02020202, 
		158,	0x02020202, 
		160,	0x01020202, 
		161,	0x01010064, 
		162,	0x01010101, 
		163,	0x01010101, 
		165,	0x00020101, 
		166,	0x00000064, 
		167,	0x00000000, 
		168,	0x000b0b00, 
		169,	0x14480000, 
		170,	0x02000200, 
		171,	0x02000200, 
		172,	0x00001448, 
		173,	0x00006568, 
		174,	0x14480708, 
		175,	0x02000200, 
		176,	0x02000200, 
		177,	0x00001448, 
		178,	0x00006568, 
		179,	0x02020708, 
		180,	0x80000100, 
		181,	0x04070303, 
		182,	0x0000000a, 
		183,	0x00000000, 
		184,	0x00000000, 
		185,	0x0010ffff, 
		186,	0x1a070303, 
		187,	0x0000000f, 
		188,	0x00000000, 
		189,	0x00000000, 
		190,	0x00000000, 
		191,	0x00000000, 
		192,	0x00000000, 
		193,	0x00000000, 
		194,	0x00000204, 
		195,	0x00000000, 
		196,	0x00000000, 
		197,	0x00000000, 
		198,	0x00000000, 
		199,	0x00000000, 
		200,	0x00000000, 
		201,	0x00000000, 
		202,	0x00000007, 
		203,	0x00000007, 
		204,	0x00000000, 
		205,	0x00000040, 
		206,	0x00060601, 
		207,	0x00000000,
		0xffffffff
};

unsigned int ddr3_init_tab_1600[] = {
		0,	0x00000600,
		1,	0x00000000, 
		3,	0x000000a0, 
		4,	0x00000190, 
		5,	0x16081600, 
		6,	0x06040408, 
		7,	0x0b061c27,
		8,	0x061c2706,
		9,	0x0c04060b, 
		10,	0x0400db60, 
		11,	0x0c040604, 
		12,	0x0400db60, 
		13,	0x01000004, 
		14,	0x0b0c1001, 
		15,	0x0017170c, 
		16,	0x03000200, 
		17,	0x00002020, 
		18,	0x0b0b0000, 
		19,	0x00000000, 
		20,	0x00011801, 
		21,	0x01181858, 
#ifdef CONFIG_DDR775
		22,	0x00051795, 
#else //DDR800
		22,	0x00051858, 
#endif
		23,	0x00000500, 
		24,	0x00140005, 
		25,	0x00000014, 
		26,	0x00000000, 
		27,	0x02000000, 
		28,	0x02000120, 
		29,	0x00000120, 
		30,	0x08000001, 
		31,	0x00080808, 
		32,	0x00000000, 
		35,	0x00000000, 
		36,	0x01000000, 
		37,	0x10000000, 
		38,	0x00100400, 
		39,	0x00000400, 
		40,	0x00000100, 
		41,	0x00000000, 
		42,	0x00000001, 
		43,	0x00000000, 
		44,	0x000c7000, 
		45,	0x00180046, 
		46,	0x00460c70, 
		47,	0x00000018, 
		48,	0x0c700000, 
		49,	0x00180046, 
		50,	0x00460c70, 
		51,	0x00000018, 
		52,	0x0c700000, 
		53,	0x00180046, 
		54,	0x00460c70, 
		55,	0x00000018, 
		56,	0x0c700000, 
		57,	0x00180046, 
		58,	0x00460c70, 
		59,	0x00000018, 
		60,	0x00000000, 
		61,	0x00010100, 
		62,	0x00000000, 
		63,	0x00000000, 
		64,	0x00000000, 
		65,	0x00000000, 
		66,	0x00000000, 
		67,	0x00000000, 
		68,	0x00000000, 
		69,	0x00000000, 
		70,	0x00000000, 
		71,	0x00000000, 
		72,	0x00000000, 
		73,	0x00000000, 
		74,	0x00000000, 
		75,	0x00000000, 
		76,	0x00000000, 
		77,	0x00000000, 
		78,	0x01000200, 
		79,	0x02000040, 
		80,	0x00400100, 
		81,	0x00000200, 
		82,	0x01000001, 
		83,	0x01ffff0a, 
		84,	0x01010101, 
		85,	0x03010101, 
		86,	0x01000003, 
		87,	0x0000010c, 
		88,	0x00010000, 
		89,	0x00000000, 
		90,	0x00000000, 
		91,	0x00000000, 
		92,	0x00000000, 
		93,	0x00000000, 
		94,	0x00000000, 
		95,	0x00000000, 
		96,	0x00000000, 
		97,	0x00000000, 
		98,	0x00000000, 
		99,	0x00000000, 
		100,	0x00000000, 
		101,	0x00000000, 
		102,	0x00000000, 
		103,	0x00000000, 
		104,	0x00000000, 
		105,	0x00000000, 
		106,	0x00000000, 
		107,	0x00000000, 
		108,	0x02040108, 
		109,	0x08010402, 
		110,	0x02020202, 
		111,	0x01000201, 
		112,	0x00000200, 
		113,	0x00000000, 
		114,	0x00000000, 
		115,	0x00000000, 
		116,	0x19000000, 
		117,	0x00000028, 
		118,	0x00000000, 
		119,	0x00010001, 
		120,	0x00010001, 
		121,	0x00010001, 
		122,	0x00010001, 
		123,	0x00010001, 
		124,	0x00000000, 
		125,	0x00000000, 
		126,	0x00000000, 
		127,	0x00000000, 
		128,	0x00232300, 
		129,	0x23230001, 
		130,	0x00000001, 
		131,	0x00000000, 
		132,	0x00000000, 
		133,	0x00012323, 
		134,	0x00012323, 
		135,	0x00000000, 
		136,	0x00000000, 
		137,	0x00232300, 
		138,	0x23230001, 
		139,	0x00000001, 
		140,	0x00000000, 
		141,	0x00000000, 
		142,	0x00012323, 
		143,	0x00012323, 
		144,	0x00000000, 
		145,	0x00000000, 
		146,	0x00232300, 
		147,	0x23230001, 
		148,	0xffff0001, 
		149,	0x00ffff00, 
		150,	0x0000ffff, 
		151,	0x00000000, 
		152,	0x03030303, 
		153,	0x03030303, 
		156,	0x02006400, 
		157,	0x02020202, 
		158,	0x02020202, 
		160,	0x01020202, 
		161,	0x01010064, 
		162,	0x01010101, 
		163,	0x01010101, 
		165,	0x00020101, 
		166,	0x00000064, 
		167,	0x00000000, 
		168,	0x000b0b00, 
		169,	0x18580000, 
		170,	0x02000200, 
		171,	0x02000200, 
		172,	0x00001858, 
		173,	0x000079b8, 
		174,	0x1858080a, 
		175,	0x02000200, 
		176,	0x02000200, 
		177,	0x00001858, 
		178,	0x000079b8, 
		179,	0x0202080a, 
		180,	0x80000100, 
		181,	0x04070303, 
		182,	0x0000000a, 
		183,	0x00000000, 
		184,	0x00000000, 
		185,	0x0010ffff, 
		186,	0x1c070303, 
		187,	0x0000000f, 
		188,	0x00000000, 
		189,	0x00000000, 
		190,	0x00000000, 
		191,	0x00000000, 
		192,	0x00000000, 
		193,	0x00000000, 
		194,	0x00000204, 
		195,	0x00000000, 
		196,	0x00000000, 
		197,	0x00000000, 
		198,	0x00000000, 
		199,	0x00000000, 
		200,	0x00000000, 
		201,	0x00000000, 
		202,	0x00000008, 
		203,	0x00000008, 
		204,	0x00000000, 
		205,	0x00000040, 
		206,	0x00070701, 
		207,	0x00000000,
		0xffffffff
};

unsigned int ddr2_mode_reg_tab[] = {
		0x0320,
		0x0046,
		0x0000,
		0x0000
};

unsigned int ddr3_mode_reg_tab[] = {
		0x0320,
		0x0046,
		0x0000,
		0x0000
};

unsigned int ddr_clk_tab[] = {
		333,	0x07800000,	0x1e0f1200,
		400,	0x08000000,	0x20101000,
		533,	0x08000000,	0x20100c00,
		666,	0x07800000,	0x1e0f0900,  
#ifdef CONFIG_DDR775
		775,    0x07c00000,	0x1f100800,
#endif
		800,	0x08000000,	0x20100800,
		0xffffffff
};
